<template>
  <div>
    <el-container>
      <el-aside width="200px">
        <el-menu :default-openeds="['1','2','3']">
          <el-submenu index="1">
            <template slot="title"><i class="el-icon-s-custom"></i>护工信息管理</template>
            <el-menu-item-group>
              <el-menu-item index="1-1">
                <router-link to="/AssisHome/AssistantInfo">
                  护工信息列表
                </router-link>
              </el-menu-item>
              <el-menu-item index="1-2">
                <router-link to="/AssisHome/FindAssistant">
                  查询护工信息
                </router-link>
              </el-menu-item>
              <el-menu-item index="1-3">
                <router-link to="/AssisHome/UpdatePwd">
                  更改密码
                </router-link>
              </el-menu-item>
              <el-menu-item index="1-4">
                <router-link to="/AssisHome/salary">
                  薪资查询
                </router-link>
              </el-menu-item>
              <el-menu-item index="1-5">
                <router-link to="/AssisHome/UpdateAssis">
                  修改当前护工信息
                </router-link>
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title"><i class="el-icon-moon-night"></i>老人信息管理</template>
            <el-menu-item-group>
              <el-menu-item index="2-1">
                <router-link to="/AssisHome/OlderInfo">
                  老人信息
                </router-link>
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title"><i class="el-icon-s-home"></i>床位信息管理</template>
            <el-menu-item-group>
              <el-menu-item index="3-1">
                <router-link to="/AssisHome/BedInfo">
                  床位信息列表
                </router-link>
              </el-menu-item>
              <el-menu-item index="3-1">
                <router-link to="/AssisHome/UnuseBed">
                  未用床位信息列表
                </router-link>
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="4">
            <template slot="title"><i class="el-icon-chat-line-square"></i>问题记录管理</template>
            <el-menu-item-group>
              <el-menu-item index="4-1">
                <router-link to="/AssisHome/Question">
                  问题列表
                </router-link>
              </el-menu-item>
              <el-menu-item index="4-2">
                <router-link to="/AssisHome/InQuestion">
                  问题记录
                </router-link>
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="5">
            <template slot="title"><i class="el-icon-chat-line-square"></i>请假记录管理</template>
            <el-menu-item-group>
              <el-menu-item index="5-1">
                <router-link to="/AssisHome/SundayList">
                  请假列表
                </router-link>
              </el-menu-item>
              <el-menu-item index="5-2">
                <router-link to="/AssisHome/Sunday">
                  请假申请
                </router-link>
              </el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: right; font-size: 12px">
          <el-dropdown>
            <i class="el-icon-setting" style="margin-right: 15px"></i>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item icon="el-icon-switch-button" @click.native="Logout"></el-dropdown-item>
              <el-dropdown-item icon="el-icon-loading" @click.native="nothing"></el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <span>护工： </span>
          <span>{{$store.getters.getLoginParam.username}}</span>
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>

</template>

<script>
    export default {
        name: "AssisHome",
        data() {
            return {}

        },
        methods: {
            Logout() {
                this.$store.commit('setLoginParam', '')
                this.$message.success(' 注销登录成功！');
                // replace 不可回退  铺设可以
                this.$router.push('/')
            },
            nothing() {
                this.$message.info('尚在马不停蹄的开发新功能中');

            },
        }
    }
</script>

<style scoped>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }

  .el-aside {
    color: #333;
  }

  a {
    text-decoration: none;
  }

  .router-link-active {
    text-decoration: none;
  }
</style>
